package com.oceansoft.core.common.util;

/**
 * 类处理
 * 
 * @author Administrator
 * 
 */
public class ClassUtil {

	public static Object getInstanceByClassName(String className) {
		if (className != null) {
			try {
				Class<?> valueClazz = Class.forName(className);
				Object obj = valueClazz.newInstance();
				return obj;
			} catch (InstantiationException e) {
				e.printStackTrace();
			} catch (IllegalAccessException e) {
				e.printStackTrace();
			} catch (ClassNotFoundException e) {
				e.printStackTrace();
			}
		}
		return null;
	}

	public static Class<?> getClassByClassName(String className) {
		if (className != null) {
			try {
				Class<?> valueClazz = Class.forName(className);
				return valueClazz;
			} catch (ClassNotFoundException e) {
				e.printStackTrace();
			}
		}
		return null;
	}
}
